package com.item.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@RequiredArgsConstructor
@TableName("`user`")
public class User implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @NonNull
    private String username;

    @NonNull
    private String password;

    private String phone;

    private String card;

    private String email;

    private Integer userState;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date registrationTime;

    public User(Integer id, @NonNull String password, String phone) {
        this.id = id;
        this.password = password;
        this.phone = phone;
    }
}
